/*
    IceCode toolkit - Test Framework.
    Copyright (C) 2011 Alfredo 'IceCoder' Mungo

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _ICECODE_GALILEI_XMLOUTPUT
#define _ICECODE_GALILEI_XMLOUTPUT

#include "Test.hpp"
#include "TimedTest.hpp"
#include <string>

namespace icecode {
  namespace test {

    void XMLOutput_Test(std::string fname, icecode::test::Test& t);
    void XMLOutput_TimedTest(std::string fname, icecode::test::TimedTest& t);

    template<class T>
    class XMLOutput {
      /*@!
	ARGUMENTS:
	 t: T
	  Test class to generate a output from.
	 fname: std::string (optional, default "./test.xml")
	  The filename of the XML file to be created.
       */
    public: XMLOutput(T& t, std::string fname = "./test.xml") {}
    };

    template<>
    class XMLOutput<icecode::test::Test> {
    public: XMLOutput(Test& t, std::string fname = "./test.xml") { XMLOutput_Test(fname, t); }
    };

    template<>
    class XMLOutput<icecode::test::TimedTest> {
    public: XMLOutput(TimedTest& t, std::string fname = "./test.xml") { XMLOutput_TimedTest(fname, t); }
    };
  }
}

#endif //_ICECODE_GALILEI_XMLOUTPUT
